<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>一点养老多用户商城API文档</title>
    <link rel="stylesheet" href="HyperDown/github-markdown.css">
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css">
    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    <style>
        body{
            font-size: 14px;
            font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
        }
        .markdown-body {
            box-sizing: border-box;
            min-width: 200px;
            max-width: 980px;
            margin: 0 auto;
            padding: 45px 45px 45px 300px;
        }

        .sidebar {
            position: fixed;
            left: 10px;
            top: 10px;
            overflow-y: scroll;
        }
        .sidebar span{
            display:block;

        }
        .sidebar span a{
            display:block;
            color:rgb(65,131,196);

        }

        .toc-h2 > a{
            padding:.8em 0 0 2em;
        }

        .toc-h3 > a{
            padding:.8em 0 0 4em;
        }

        .toc-h4{
            font-size: 0.8em;
        }

        .toc-h4 > a{
            padding:.8em 0 0 6em;
        }

        td{
        }
    </style>
    <script>
        document.addEventListener("DOMContentLoaded", function(event) {
            var sidebar = document.querySelector(".sidebar");
            sidebar.style.height = window.innerHeight + "px";
            document.querySelector(".markdown-body").style.marginLeft = window.getComputedStyle(sidebar).width;
        });

    </script>
</head>
<body>
<div class="markdown-body">
    <?php
    require_once("HyperDown/Parser.php");

    $parser = new HyperDown\Parser;
    echo $parser->makeHtml(file_get_contents("api.md"));
    ?>
</div>
<div class="sidebar">
    <?php foreach($parser->getToc() as $title): ?>
        <span class="toc toc-h<?=$title[0]?>">
            <a href="#header-<?=$title[1]?>"><?=$title[2]?></a>
        </span>
    <?php endforeach;?>
</div>

</body>
</html>
